<?php 
	session_start();
	$var1= $_SESSION["registrado"];
	$var2= $_SESSION["administrador"];
	if ($var1 == null): {
		echo ("User not registered");
	} elseif ($var2 == 0): { 
			echo ("User without permissions");
	} else : {
?>


<!doctype html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<link href="css/bootstrap.css" rel="stylesheet" media="screen">
<link href="css/bootstrap-responsive.css" rel="stylesheet"	media="screen">

<title>My project manager</title>

<style type="text/css">
  body {
    padding-top: 60px;
    padding-bottom: 40px;
  }
  .sidebar-nav {
    padding: 9px 0;
  
  }
    .container {
    padding-top: 100px;
  }

    .finish {
    padding-top: 300px;
    padding-left: 25px;
    padding-right: 25px;
  }
  

  
  @media (max-width: 980px) {
    /* Enable use of floated navbar text */
    .navbar-text.pull-right {
      float: none;
      padding-left: 5px;
      padding-right: 5px;
    }
  }
</style>

</head>

<body>
<?php include ('configuration.php'); ?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap.js"></script>


<div class="navbar navbar-inverse navbar-fixed-top">
	<div class="navbar-inner">
		<div class="container-fluid">
			<button type="button" class="btn btn-navbar" data-toggle="collapse"
				data-target=".nav-collapse">
				<span class="icon-bar"></span> <span class="icon-bar"></span> <span
					class="icon-bar"></span>
			</button>
			<a class="brand" href="http://localhost/bases--grupo10/homeAdmin.php?">My project manager</a>
			<div class="nav-collapse collapse">
				<p class="navbar-text pull-right">
				
					<a href="http://localhost/bases--grupo10/logout.php?" class="navbar-link">Log out</a>
				</p>
				<ul class="nav">
					<li class="active"><a href="http://localhost/bases--grupo10/homeAdmin.php?">Home</a></li>
					<li><a href="http://localhost/bases--grupo10/about.php?">About</a></li>
					<li><a href="http://localhost/bases--grupo10/contact.php?">Contact</a></li>
				</ul>
			</div>
		</div>
	</div>
</div>
<div class="span12" >	
	<h1 class="muted">Modify project </h1>
	<h3 class="muted" style="font-weight:bold">Make changes > Modify members and responsibles </h3>
	<p style="font-weight:bold">Select a member and an option or modify the participants adding or deleting a member</p>  
</div>	
	
<form method="post" action="modifyProject3_options.php">	   
    <div class="container">
        <div class="span12">
    	<div class="container-fluid">
        	<div class="control-group">	
        		<select name="select_member">
            		<option value="0">Select a member</option>
            		<?php  
        	    		$id_project = $_SESSION["id_proj"];
        	    		$q = mysql_query("SELECT id_member_participate FROM participate WHERE id_project_participate = '$id_project'");
        	    		$q_array = mysql_fetch_assoc($q);	    
        				$num_resultados= mysql_num_rows($q);
        			
        				for ($i=1;$i<$num_resultados+1; $i++) {
        					$res = mysql_result($q, $i-1);
        					$query = mysql_query("SELECT id_member, name_member, surnames_member, mail_member FROM project_member
        	    								WHERE id_member = '$res' ORDER BY name_member ASC");
            				$row1 = mysql_fetch_array($query);
        					echo "<option value=".$row1['id_member'].">".$row1['name_member']." ".$row1['surnames_member']."</option>";
        				}   
                    ?>        
                </select>
            	
            	<select name="select_option" id="options">
            		<option value="0">Select an option</option>
            		<option value="1">Check as responsible</option>
            		<option value="2">Uncheck as responsible</option>
            		<option value="3">Delete member</option>
               </select>     
               <input class="btn btn-primary" type="submit" value="Go">
    	    </div>
    	    <div class="control-group">
    	        <a class="btn btn-primary" type="button" href="http://localhost/bases--grupo10/modifyProject3_addMember.php?" >Add member</a>
    	    </div>	
	    </div>
        </div> 
    </div> 

    <div class="finish">
        <a class="btn btn-primary pull-right" type="button" href="http://localhost/bases--grupo10/homeAdmin.php?" >Finish</a>  	
    	<a class="btn btn-primary pull-left" type="button" href="http://localhost/bases--grupo10/modifyProject2_restore.php?" >Back</a> 
    </div> 

</form >


</body>
</html>

<?php }endif;?>